import req from '@/utils/request'

// 获取部门列表   department
export function getDeparts(params) {
  return req({
    url: '/admin/department/data',
    method: 'get',
    params
  })
}

// 添加部门
export function addDeparts(data) {
  return req({
    url: '/admin/department/save',
    method: 'post',
    data
  })
}

// 删除部门
export function delDeparts(id) {
  return req({
    url: `/admin/department/remove/${id}`,
    method: 'delete'
  })
}

// 批量删除部门
export function batchDeparts(data) {
  return req({
    url: '/admin/department/batchRemove',
    method: 'post',
    data
  })
}

// 激活用户 / 禁用账号
export function enableDeparts(data) {
  return req({
    url: '/admin/department/enable',
    method: 'put',
    data
  })
}
export function disableDeparts(data) {
  return req({
    url: '/admin/department/disable',
    method: 'put',
    data
  })
}

// 更新部门
export function editDeparts(data) {
  return req({
    url: '/admin/department/update',
    method: 'put',
    data
  })
}

// 编辑部门权限
export function editDepartsPower(data) {
  return req({
    url: '/admin/department/saveDepartmentPower',
    method: 'put',
    data
  })
}

